
<div class="alert alert-info alert-fn-valid" style="line-height:26px;">
    <strong>提示！</strong>add eassy ：）   
</div>

<form id="operateEssayForm" role="form" class="form-horizontal">
    <div class="hide">
        <input type="hidden" id="id" ng-model="source.curEssay.id"/>
    </div>

    <div class="form-group">      
        <label for="title" class="col-sm-2 control-label">标题</label>
        <div class="col-sm-9 input-group">            
            <div class="pointer input-group-addon" ng-click="manageStar()">
                <i class="glyphicon" 
                    ng-class="{'glyphicon-star font-star':source.curEssay.is_star==1, 'glyphicon-star-empty':source.curEssay.is_star==0}"></i>
            </div>
            <input type="text" id="title" name="title" class="form-control" placeholder="请输入标题" ng-model="source.curEssay.title" />

            <div class="pointer input-group-addon" ng-click="manageTag()">
                <i class="glyphicon glyphicon-tag" 
                    ng-class="{'font-tag':source.curEssay.tags.length>0}"></i>
            </div>
        </div>
    </div>
    <div class="form-group">    
        <label for="category" class="col-sm-2 control-label">类别</label>
        <div class="col-sm-9 input-group" >
            <select name="category" id="category" class="form-control"
                ng-model="source.curEssay.category_id"
                ng-options="category.id as category.title for category in source.categoryList">
            </select>

            <div id="iCategory" class="pointer input-group-addon">
              <i class="glyphicon glyphicon-th-list"></i>
            </div>
        </div>
    </div>
    <div class="form-group">    
        <label for="postTime" class="col-sm-2 control-label">发布时间</label>
        <div class="col-sm-4 input-group date form_datetime" >
            <input type="text" name="postTime" id="postTime" class="form-control"
                ng-model="source.curEssay.post_time" readonly>
            </input>
            
            <span class="input-group-btn">
              <button class="btn default date-set" type="button"><i class="glyphicon glyphicon-calendar"></i></button>
            </span>
        </div>
    </div>
    <div class="form-group">    
      <label for="content" class="col-sm-2 control-label">内容</label>
        <div class="col-sm-9 input-group">
            <textarea id="content" name="content" rows="5" class="form-control" placeholder = "请输入标题"  ng-model="source.curEssay.content" /></textarea>
        </div>
    </div>

    <hr/>

    <div class="form-group"> 
        <div class="col-sm-offset-2 col-sm-10">
            <a class="btn btn-primary" ng-click="submitEssay()">
              Submit
            </a>
            <a class="btn btn-default btn-margin-left" href="#/list/2">
              Cancel
            </a>
        </div>
    </div>
</form>


<script type="text/javascript" src="/javascripts/jquery/jquery-validate/jquery.validate.min.js"></script>  
<!--metadata.js 验证的时候可以使用class="{}"的方式
    class="{required:true,minlength:5,messages:{required:'请输入内容'}}"
    在使用equalTo关键字时，后面的内容必须加上引号，如下代码：
    class="{required:true,minlength:5,equalTo:'#password'}"
-->
<script type="text/javascript" src="/javascripts/jquery/jquery-validate/jquery.metadata.js"></script>  
<script type="text/javascript" src="/javascripts/jquery/jquery-validate/additional-methods.js"></script>  
<script type="text/javascript" src="/javascripts/jquery/jquery-validate/validate.messages.cn.js"></script>  

<link rel='stylesheet' href="/javascripts/bootstrap-datetimepicker/css/datetimepicker.css" />
<script type="text/javascript" src="/javascripts/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>